package com.mmall.concurrency.tujie.chapter3;

import lombok.extern.slf4j.Slf4j;

/**
 * @author 孙许
 * @date 2018-05-20
 * @description
 */
@Slf4j
public class Main {
    public static void main(String[] args) {
        RequestQueue requestQueue = new RequestQueue();
        ClientThread alice = new ClientThread(requestQueue, "Alice", 3141592L);
        alice.start();
        ServerThread bobby = new ServerThread(requestQueue, "Bobby", 6535897L);
        bobby.start();

        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        log.info("***** calling interrupt ****");
        alice.interrupt();
        bobby.interrupt();
    }
}
